using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FiltronASP.Models;
using FiltronASP.Models.DAO;
using FiltronASP.Models.DAO.Interfaces;
using FiltronASP.Models.DAO.WIX;
using FiltronASP.Models.DAO.Interfaces.WIX;

namespace FiltronASP.Helpers.CatalogueHelpers
{
    public class SingleFilterHelper
    {
        public static decimal parseFilterSizes(decimal size) {
            return decimal.Round(size, 0);
        }

        public static decimal convertInchesToMetric(decimal size) { 
            return size * (decimal)25.4;
        }

        public static string getFilterStyle(int styleId) {
            IWixFilterStyleDAO filterStyleDAO = new WixFilterStyleDAO();
            if (styleId > 0) {
                return filterStyleDAO.FindByPK(Convert.ToInt32(styleId)).style_name;
            }
            return String.Empty;
        }

        public static string getFilterType(int typeId)
        {
            IWixFilterTypeDAO filterTypeDAO = new WixFilterTypeDAO();
            if (typeId > 0)
            {
                return filterTypeDAO.FindByPK(Convert.ToInt32(typeId)).type_name;
            }
            return String.Empty;
        }

        public static string getMediaType(int mediaId)
        {
            IWixFilterMediaDAO filterMediaDAO = new WixFilterMediaDAO();
            if (mediaId > 0)
            {
                return filterMediaDAO.FindByPK(Convert.ToInt32(mediaId)).media_name;
            }
            return String.Empty;
        }

        public static string getFilterService(int serviceId) {
            switch (serviceId) {
                case 3: 
                    return "FF";
                case 4:
                    return "BP";
                case 5:
                    return "KT";
                case 6:
                    return "FB";
            }
            return String.Empty;
        }


    }
}
